
<!doctype html>
<html lang="en">
<head>
<META HTTP-EQUIV="pragma" CONTENT="no-cache"> 
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate"> 
<META HTTP-EQUIV="expires" CONTENT="0">
<meta charset="UTF-8" />
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../../layui/css/layui.css" media="all">
<script src="../../../layui/layui.js" charset="utf-8"></script>
<script src="../../../js/angular.js" charset="utf-8"></script>
<script src="../../../layui/jquery-3.2.1.min.js" charset="utf-8"></script>
<script type="text/javascript" src="../gjjhbj/fy.js"></script>


	<link rel="stylesheet" href="../../../css/font_eolqem241z66flxr.css" media="all" />
	<link rel="stylesheet" href="../../../css/news.css" media="all" />
	<script type="text/javascript" src="../../../layui/layui/GetPath.js"></script>
	<script src="../../../layui/layui/layui.js" charset="utf-8"></script>
<style>
.layui-form-label {
	text-align: right;
}
.layui-form-item{
	height:30px;
	width:100%;
}
</style>


</head>
<body class="childrenBody">
	<div ng-app="myApp" ng-controller="customersCtrl" align="center">
	<loading>查询中请稍后</loading>
		<div class="layui-form-item">
		
			<div class="layui-inline">
				<label class="layui-form-label">单位地址:</label>
				<div class="layui-input-inline">
					<input type="text" name="BGHDWDZ" id="BGHDWDZ" autocomplete="off"
						class="layui-input">
				</div>
			</div>
			
			<div class="layui-inline">
				<label class="layui-form-label">单位邮编:</label>
				<div class="layui-input-inline">
					<input type="text" name="BGHDWYB" id="BGHDWYB" autocomplete="off" class="layui-input">
				</div>
			</div>
			
			<div class="layui-inline">
				<label class="layui-form-label">缴存银行:</label>
				<div class="layui-input-inline">
						<select class="layui-input" id="xl" ng-change="se()" ng-model="yh" disabled="disabled">
							<option ng-repeat="d in data" id="BGHJCYH"  name="BGHJCYH" value="{{d.DM}}">{{d.JCYH}}</option>
						</select>
				</div>
			</div>
		</div>

		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">法人代表:</label>
				<div class="layui-input-inline">
					<input type="text" name="BGHDWFRDBXM" id="BGHDWFRDBXM" readonly="readonly"
						autocomplete="off" class="layui-input">
				</div>
			</div>
			
			<div class="layui-inline">
				<label class="layui-form-label">法人电话:</label>
				<div class="layui-input-inline">
					<input type="text" name="BGHTELEPHONE" id="BGHTELEPHONE"
						autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">开户银行:</label>
				<div class="layui-input-inline">
					<input type="text" name="BGHKHYH" id="BGHKHYH" autocomplete="off"
						class="layui-input">
				</div>
			</div>
		</div>

		<div class="layui-form-item">
		
			<div class="layui-inline">
				<label class="layui-form-label">财务负责人:</label>
				<div class="layui-input-inline">
					<input type="text" name="BGHCWFZR" id="BGHCWFZR" autocomplete="off"
						class="layui-input">
				</div>
			</div>
			
			<div class="layui-inline">
				<label class="layui-form-label">财务电话:</label>
				<div class="layui-input-inline">
					<input type="text" name="BGHCWFZRDH" id="BGHCWFZRDH"
						autocomplete="off" class="layui-input">
				</div>
			</div>
			
<div class="layui-inline">
				<label class="layui-form-label">电子信箱:</label>
				<div class="layui-input-inline">
					<input type="text" name="BGHDWDZXX" id="BGHDWDZXX"
						autocomplete="off" class="layui-input">
				</div>
			</div>			
		</div>	
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">经办人姓名:</label>
				<div class="layui-input-inline">
					<input type="text" name="BGHJBRXM" id="BGHJBRXM" readonly="readonly"
						autocomplete="off" class="layui-input">
				</div>
			</div>
			
			<div class="layui-inline">
				<label class="layui-form-label">经办人手机:</label>
				<div class="layui-input-inline">
					<input type="text" name="BGHJBRSJHM" id="BGHJBRSJHM"
						autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">单位发薪日:</label>
				<div class="layui-input-inline">
					<input type="text" name="BGHDWFXR" id="BGHDWFXR" autocomplete="off"
						class="layui-input">
				</div>
			</div>
		</div>
		<div class="layui-form-item" >
			<div class="layui-inline">
				<label class="layui-form-label">单位比例:</label>
				<div class="layui-input-inline">
					<input type="text" name="BGHDWJCBL" id="BGHDWJCBL" readonly="readonly"
						autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-inline" align="left">
				<label class="layui-form-label">个人比例:</label>
				<div class="layui-input-inline">
					<input type="text" name="BGHGRJCBL" id="BGHGRJCBL" readonly="readonly"
						autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-inline" align="left">
				<label class="layui-form-label"></label>
				<div class="layui-input-inline">
				</div>
			</div>
		</div>

		<div class="layui-form-item">
			<div class="layui-input-block">
				 <input ng-click="su()" id="submit" type="button" class="layui-btn " value="提交申请">
			</div>
		</div>

</div>
	
	
	<script>
				layui.use('layer', function(){
  var layer = layui.layer;
  
});  
	</script>
	<script type="text/javascript">
		function getPath() {
			return 'http://' + location.host;
		}
		var app = angular.module('myApp', []);
		 app.directive('loading', function(){  
		        return {  
		            restrict: 'E',  
		            transclude: true,  
		            template: '<div ng-show="loading" class="loading" id="allDiv"  style="position:fixed; top:0px; left:0px; width:100%; height:100%; display:none; background-color:#000; opacity: 0.5; z-index:99999;">'  
		            +'<img alt="" src="../../../layui/layui/img/jz.gif" style="vertical-align: middle;width:30px; height:30px; position: absolute; top:50%; left:50%; margin-top: -50px; margin-left:-50px;"/>'
		            +'</div>',  
		            link: function (scope, element, attr) {  
		                scope.$watch('loading', function (val) {  
		                    if (val){  
		                        document.getElementById("allDiv").style.display = "block";  
		                    }else{  
		                        document.getElementById("allDiv").style.display = 'none';  
		  
		                    }  
		                });  
		            }  
		        };
		    }); 
		   
		  app.controller('customersCtrl', function($scope, $http) {
		   $scope.setLoading =function(){  
			    if($scope.loading ==undefined || $scope.loading ==false){  
			        $scope.loading=true;  
			    }else{  
			        $scope.loading=false;  
			    };
			};
		  $("#submit").hide();
			$("#reset").hide();
			$scope.setLoading();
		  	$http({
							url:getPath() + "/wsyyt/dwbjhjqccontroller/xlhx",
							contentType:"text/html;charset=utf-8",
							method:'post',
							//params:{GRZH:$scope.data[index].GRZH,JCQK:$scope.data[index].JCQK}				
						})
					.then(
					
							function(res,res1,res2,res3,res4) {
							$scope.setLoading();
							console.info(res);
								
								$scope.data = res.data.data5;
		
		$("#form1 input[type='text']").attr("readonly","readonly");
		$("#form1 input[type='text']").attr("style","border:none");
		function getQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]); return null;
    }
var  detail= getQueryString('cc');
	if(detail==1){
	layer.alert('提示信息正在审核，无法继续修改：', {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认'] //按钮
								      ,icon: 5    // icon
								     ,btn2:function(){
										
								     }});	
	$.ajax({
				url : getPath() + '/wsyyt/dwxxbgcontroller/test1',
				method : 'post',
				dataType : 'JSON',
				success : function(result) {
					var data = result.data;
					
				 var sel = document.getElementById('xl');
				 var d=sel.value;
				  for(var i=0;i<sel.options.length;i++){
        if(sel.options[i].value==data[0].BGHJCYH){
        $("#BGHJCYH").val(data[0].BGHJCYH);
            sel.options[i].selected=true;
            break;
            alert(sel.options[i].DM);
            sel.val(sel.options[i].DM);
        }
    }
 
						$.each(data[0], function(key, value) {
							$("#" + key).val(value || "");
						});
						
				}
			});
	}
	else{
	$("#submit").show();
	$("#reset").show();
		$.ajax({
				url : getPath() + '/wsyyt/dwxxbgcontroller/test',
				method : 'post',
				dataType : 'JSON',
				success : function(result) {
					var data = result.data;
					 var sel = document.getElementById('xl');
					 console.info(data[0]);
				  for(var i=0;i<sel.options.length;i++){
        if(sel.options[i].text==data[0].JCYH){
            sel.options[i].selected=true;
             $("#BGHJCYH").val(data[0].BGHJCYH);
             break;
           
        }
        }
						$.each(data[0], function(key, value) {
							$("#BGH" + key).val(value || "");
						});
						 $("#BGHJCYH").val(data[0].GJJJCH);
						
				}
			});
			}
		
			
				$scope.su=function(){
				
					var bDWYB = $("#BGHDWYB").val();
						var bSJHM = $("#BGHTELEPHONE").val();
						var bCWFZR = $("#BGHCWFZR").val();
						var bCWFZRDH = $("#BGHCWFZRDH").val();
						var bKHYH = $("#BGHKHYH").val();
						var bZH = $("#BGHZHANGH").val();
						var bFRDH=$("#BGHTELEPHONE").val();
						var bJBRXM=$("#BGHJBRXM").val();
						var bDWDZXX = $("#BGHDWDZXX").val();
						var bDWFXR = $("#BGHDWFXR").val();
						var bJBRSJHM = $("#BGHJBRSJHM").val();
						var bJCYH=$("#xl").val();
						var bDWJCBL = $("#BGHDWJCBL").val();
						var bGRJCBL = $("#BGHGRJCBL").val();
						var bFRDBXM=$("#BGHDWFRDBXM").val();
						var bDWDZ=$("#BGHDWDZ").val();
						//原信息
						if (bDWYB != "" && bFRDBXM != ""&&bFRDBXM!=""
								&& bSJHM != "" && bCWFZR != ""
								&& bCWFZRDH != ""
							 	&& bKHYH != ""
								&& bDWFXR != "" 
								&& bJBRSJHM != ""
								&& bJBRSJHM.length == 11 && bDWJCBL > 4
								&& bDWJCBL<13 && bGRJCBL>4 && bGRJCBL < 13) {
								$scope.setLoading();
									$http({
							url:getPath() + "/wsyyt/dwxxbgcontroller/bg",
							contentType:"text/html;charset=utf-8",
							method:'post',
							params:{'bGRJCBL' : bGRJCBL,
									'bDWJCBL' : bDWJCBL,
									'bJCYH' : bJCYH,
									'bDWYB' : bDWYB,
									'bDWFRDBXM' : bFRDBXM,
									'bSJHM' : bSJHM,
									'bCWFZR' : bCWFZR,
									'bCWFZRDH' : bCWFZRDH,
									'bKHYH' : bKHYH,
									'bZH' : bZH,
									'bDWDZXX' : bDWDZXX,
									'bDWFXR' : bDWFXR,
									'bJBRSJHM' : bJBRSJHM,
									'bFRDH' : bFRDH,
									'bFRDBXM':bFRDBXM,
									'bDWDZ':bDWDZ,
									'bJBRXM':bJBRXM
									}				
						})
					.then(
					
							function(res) {
							$scope.setLoading();
								if(res.data.msg!='成功')
										layer.alert('提示：'+res.data.msg, {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认'] //按钮
								      ,icon: 5    // icon
								     ,btn2:function(){
										
								     }});	
										if(res.data.msg=='成功'){
											layer.alert('提示：'+res.data.msg, {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认'] //按钮
								      ,icon:6    // icon
								     ,btn2:function(){
										
								     }});
										}
							});
						} else if (bJBRSJHM.length != 11) {
							layer.alert("经办人手机号必须十一位！");
						} else if (bDWJCBL < 5) {
							layer.alert("单位缴存比例不能小于5");
						} else if (bDWJCBL > 12) {
							layer.alert("单位缴存比例不能大于12");
						} else if (bGRJCBL < 5) {
							layer.alert("个人缴存比例不能大于5");
						} else if (bGRJCBL > 12) {
							layer.alert("个人缴存比例不能大于12");
						} else {
							layer.alert("内容不可为空！");
						}
					};
			$("#cx").click(function() {
				table.reload('testReload', {
					url : getPath() + '/wsyyt/dwryxxcontroller/test',
					where : {
						'XM' : $("#YB").val(),
						'SFZH' : $("#SFZH").val(),
						'yj' : $("#yj").val(),
						'wj' : $("#wj").val(),
						'tj' : $("#tj").val()
					}
				//设定异步数据接的额外参数
				});
			});
								
								
								 
    
					});
		  
		  });
	</script>
	<script type="text/javascript"
		src="../../../layui/lay/modules/layer.js"></script>
	<script type="text/javascript" src="../../../layui/layui/layer.ext.js"></script>
	<script src="../../../layui/jquery-3.2.1.min.js" charset="utf-8"></script>
		<script type="text/javascript" src="../../../js/log.js"></script>
	
	<script type="text/javascript">
	

		/* 	var bDWYB=$("#DWYB1").val();
			var bDWFRDBXM=$("#DWFRDBXM1").val();
			var bSJHM=$("#TELEPHONE1").val();
			var bCWFZR=$("#CWFZR1").val();
			var bCWFZRDH=$("#CWFZRDH1").val();
			var bKHYH=$("#KHYH1").val();
			var bZH=$("#ZHANGH1").val();
			var bDWDZXX=$("#DWDZXX1").val();
			var bDWFXR=$("#DWFXR1").val();
			var bJBRSJHM=$("#JBRSJHM1").val();
			
			var bJCYH=$("#JCYH1").val();
			var bDWJCBL=$("#DWJCBL1").val();
			var bGRJCBL=$("#GRJCBL1").val();
			//原信息
			var DWZH=$("#DWZH").val();
			var DWMC=$("#DWMC").val();
			var DWYB=$("#DWYB").val();
			var DWFRDBXM=$("#DWFRDBXM").val();
			var DH=$("#DH").val();
			var CWFZR=$("#CWFZR").val();
			var CWFZRDH=$("#CWFZRDH").val();
			var KHYH=$("#KHYH").val();
			var ZH=$("#ZHANGH").val();
			var JCYH=$("#JCYH").val();
			var DWJCBL=$("#DWJCBL").val();
			var GRJCBL=$("#GRJCBL").val();
			var DWDZXX=$("#DWDZXX").val();
			var DWFXR=$("#DWFXR").val();
			var JBRSJHM=$("#JBRSJHM").val();
			$.ajax({
							url : getPath()+'/wsyyt/dwxxbgcontroller/bg',
							method : 'post',
							dataType : 'JSON',
							data: {'bGRJCBL':bGRJCBL,'bDWJCBL':bDWJCBL,'bJCYH':bJCYH,'bDWYB':bDWYB,'bDWFRDBXM':bDWFRDBXM,'bSJHM':bSJHM,'bCWFZR':bCWFZR,'bCWFZRDH':bCWFZRDH,'bKHYH':bKHYH,'bZH':bZH,'bDWDZXX':bDWDZXX,'bDWFXR':bDWFXR,'bJBRSJHM':bJBRSJHM,'DWZH':DWZH,'DWMC':DWMC,'DWYB':DWYB,'DWFRDBXM':DWFRDBXM,'DH':DH,'CWFZR':CWFZR,'CWFZRDH':CWFZRDH,'KHYH':KHYH,'ZH':ZH,'JCYH':JCYH,'DWJCBL':DWJCBL,'GRJCBL':GRJCBL,'DWDZXX':DWDZXX,'DWFXR':DWFXR,'JBRSJHM':JBRSJHM,},
							success : function(result) {
								var code = result.code;
								if(code==0){
										alert("变更成功");
									// window.location.href =getPath()+'/wsyyt/dwbjhjqccontroller/test1';
									  
								}else{				
										alert("变更失败");
									//window.location.href =getPath()+'/wsyyt/login/login.html';
									
								};
							}
						});	*/
	</script>
</body>
</html>